package com.anrongtec.zcpt.tab01;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.anrongtec.zcpt.R;
import com.anrongtec.zcpt.base.BaseFragment;
import com.anrongtec.zcpt.manager.AppDownManagerActivity;


/**
 * 可抛弃无用
 */
public class AppsManagerFragment extends BaseFragment implements View.OnClickListener {

    private LinearLayout ll_app_download;
    private LinearLayout ll_app_unload;
    private LinearLayout ll_app_upload;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_apps_manager, container, false);
        initView(view);


        return view;
    }

    private void initView(View view) {
        ll_app_download = (LinearLayout) view.findViewById(R.id.ll_app_download);//应用下载
        ll_app_unload = (LinearLayout) view.findViewById(R.id.ll_app_unload);//应用升级
        ll_app_upload = (LinearLayout) view.findViewById(R.id.ll_app_upload);//应用卸载
        initData();
    }


    @Override
    protected void initData(){
        ll_app_download.setOnClickListener(this);
        ll_app_unload.setOnClickListener(this);
        ll_app_upload.setOnClickListener(this);

    }
    @Override
    public void onDetach() {
        super.onDetach();
    }


    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.ll_app_download:
                startActivity(new Intent(getActivity(),AppDownManagerActivity.class));
                break;
            case R.id.ll_app_unload:
                startActivity(new Intent(getActivity(),AppsUnloadActivity.class));
                break;
            case R.id.ll_app_upload:
                startActivity(new Intent(getActivity(),AppDownManagerActivity.class));
                break;
                default:
                    break;
        }
    }
}
